]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
searchDisplay: Remove pendingClear
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 8 Feb 2013 21:05:28 +0000 (16:05 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 29 May 2013 15:32:49 +0000 (11:32 -0400)
It turns out that every time we call getResultsForDisplay is
directly after a setResults, so pendingClear is always true.

https://bugzilla.gnome.org/show_bug.cgi?id=693836

js/ui/searchDisplay.js

index 469d9e9593d62cea434aeeaea9073346ecd32883..ec8650c90ed222c874c5356b256fa3d130272918 100644 (file)
@@ -205,13 +205,10 @@ const ListSearchResults = new Lang.Class({
 
         this._notDisplayedResult = [];
         this._terms = [];
-        this._pendingClear = false;
     },
 
     getResultsForDisplay: function() {
-        let alreadyVisible = this._pendingClear ? 0 : this.getVisibleResultCount();
-        let canDisplay = MAX_LIST_SEARCH_RESULTS_ROWS - alreadyVisible;
-
+        let canDisplay = MAX_LIST_SEARCH_RESULTS_ROWS;
         let newResults = this._notDisplayedResult.splice(0, canDisplay);
         return newResults;
     },
@@ -228,7 +225,6 @@ const ListSearchResults = new Lang.Class({
         // copy the lists
         this._notDisplayedResult = results.slice(0);
         this._terms = terms.slice(0);
-        this._pendingClear = true;
     },
 
     _keyFocusIn: function(icon) {
@@ -245,7 +241,6 @@ const ListSearchResults = new Lang.Class({
 
     clear: function () {
         this._content.destroy_all_children();
-        this._pendingClear = false;
     },
 
     getFirstResult: function() {
@@ -271,14 +266,10 @@ const GridSearchResults = new Lang.Class({
 
         this._notDisplayedResult = [];
         this._terms = [];
-        this._pendingClear = false;
     },
 
     getResultsForDisplay: function() {
-        let alreadyVisible = this._pendingClear ? 0 : this._grid.visibleItemsCount();
-        let canDisplay = this._grid.childrenInRow(this.actor.width) * this._grid.getRowLimit()
-                         - alreadyVisible;
-
+        let canDisplay = this._grid.childrenInRow(this.actor.width) * this._grid.getRowLimit();
         let newResults = this._notDisplayedResult.splice(0, canDisplay);
         return newResults;
     },
@@ -295,7 +286,6 @@ const GridSearchResults = new Lang.Class({
         // copy the lists
         this._notDisplayedResult = results.slice(0);
         this._terms = terms.slice(0);
-        this._pendingClear = true;
     },
 
     _keyFocusIn: function(icon) {
@@ -312,7 +302,6 @@ const GridSearchResults = new Lang.Class({
 
     clear: function () {
         this._grid.removeAll();
-        this._pendingClear = false;
     },
 
     getFirstResult: function() {